package com.example.administrator.yuejian2.activity;

import android.support.design.widget.TabLayout;
import android.support.v4.app.FragmentManager;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.View;

import com.example.administrator.yuejian2.R;
import com.example.administrator.yuejian2.adapter.mFragmentPagerAdapter;

public class VLayoutActivity extends BaseActivity {

    private TabLayout tabLayout;
    private ViewPager viewPager;
    private mFragmentPagerAdapter mFragPAdapter;
    private Toolbar toolbar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_vlayout);
        initView();
    }
    private void initView() {
        tabLayout =findViewById(R.id.tablayout);
        viewPager =  findViewById(R.id.viewPager);
        toolbar =  findViewById(R.id.toolbar);
        toolbar.setTitle("唐嫣");
        setSupportActionBar(toolbar);
        mFragPAdapter=new mFragmentPagerAdapter(getSupportFragmentManager());
        viewPager.setAdapter(mFragPAdapter);
        tabLayout.setupWithViewPager(viewPager);
    }
}
